package com.aspose.cells;

import java.util.ArrayList;
import java.util.Iterator;

final class zbul {
   static com.aspose.cells.b.a.b.zg a = new com.aspose.cells.b.a.b.zg("Arial", 8.0F);
   private static final com.aspose.cells.b.c.a.za b = new com.aspose.cells.b.c.a.za(new String[]{"(", ")", "[", "]", "{", "}", "<", ">", "（", "）", "《", "》"});

   static com.aspose.cells.b.a.b.zc a(zvm var0, com.aspose.cells.b.a.b.a.ze var1) {
      if (var0.a()) {
         return new com.aspose.cells.b.a.b.zu(Color.getEmpty());
      } else {
         Object var2 = null;
         if (var0.d()) {
            var2 = var0.c().a(var1, (com.aspose.cells.b.a.b.zm)null, false, 1.0F);
         } else {
            var2 = new com.aspose.cells.b.a.b.zu(var0.b());
         }

         return (com.aspose.cells.b.a.b.zc)var2;
      }
   }

   static com.aspose.cells.b.a.b.zc a(zvm var0, com.aspose.cells.b.a.b.a.ze var1, float var2, float var3) {
      if (var0.a()) {
         return new com.aspose.cells.b.a.b.zu(Color.getEmpty());
      } else {
         Object var4 = null;
         if (var0.d()) {
            var4 = var0.c().a(var0, var1, var2, var3);
         } else {
            var4 = new com.aspose.cells.b.a.b.zu(var0.b());
         }

         return (com.aspose.cells.b.a.b.zc)var4;
      }
   }

   static com.aspose.cells.b.a.b.zc a(zvm var0, com.aspose.cells.b.a.b.zq var1) {
      if (var0.a()) {
         return new com.aspose.cells.b.a.b.zu(Color.getEmpty());
      } else {
         Object var2 = null;
         if (var0.d()) {
            var2 = var0.c().a(var1);
         } else {
            var2 = new com.aspose.cells.b.a.b.zu(var0.b());
         }

         return (com.aspose.cells.b.a.b.zc)var2;
      }
   }

   static com.aspose.cells.b.a.b.zc a(zvm var0, com.aspose.cells.b.a.b.zq var1, float var2, float var3) {
      if (var0.a()) {
         return new com.aspose.cells.b.a.b.zu(Color.getEmpty());
      } else {
         Object var4 = null;
         if (var0.d()) {
            var4 = var0.c().a(var1);
         } else {
            var4 = new com.aspose.cells.b.a.b.zu(a(var0, var2, var3));
         }

         return (com.aspose.cells.b.a.b.zc)var4;
      }
   }

   static com.aspose.cells.b.a.b.zm a(zaly var0) {
      if (var0.a()) {
         return new com.aspose.cells.b.a.b.zm(Color.getEmpty());
      } else {
         com.aspose.cells.b.a.b.zm var1 = null;
         if (var0.e() != 0) {
            var1 = new com.aspose.cells.b.a.b.zm(var0.c(), var0.f());
         } else {
            var1 = new com.aspose.cells.b.a.b.zm(var0.c(), var0.f());
            switch(var0.d()) {
            case 0:
               var1.b(5);
               var1.a(new float[]{4.0F, 4.0F});
               break;
            case 1:
               var1.b(5);
               var1.a(new float[]{4.0F, 3.0F, 1.0F, 3.0F});
               break;
            case 2:
               var1.b(2);
               break;
            case 3:
               var1.b(2);
               break;
            case 4:
               var1.b(2);
               break;
            case 5:
               var1.b(2);
               var1.a(2);
               break;
            case 6:
               var1.b(0);
               break;
            case 7:
               var1.b(2);
            }
         }

         switch(var0.b()) {
         case 1:
            var1.b(new float[]{0.0F, 0.16666667F, 0.33333334F, 0.6666667F, 0.8333333F, 1.0F});
            break;
         case 2:
            var1.b(new float[]{0.0F, 0.2F, 0.4F, 1.0F});
            break;
         case 3:
            var1.b(new float[]{0.0F, 0.6F, 0.8F, 1.0F});
            break;
         case 4:
            var1.b(new float[]{0.0F, 0.33333334F, 0.6666667F, 1.0F});
         }

         a(var1, var0);
         return var1;
      }
   }

   private static void a(com.aspose.cells.b.a.b.zm var0, zaly var1) {
      if (var1.g() != 0) {
         a(var0, var1.g(), var1.h(), var1.i(), true, var1);
      }

      if (var1.j() != 0) {
         a(var0, var1.j(), var1.k(), var1.l(), false, var1);
      }

   }

   static void a(zn var0, zbkq var1, com.aspose.cells.b.a.b.zq var2, String var3, int var4, com.aspose.cells.b.a.b.zg var5, Color var6, int var7, int var8) {
      if (var4 == 3) {
         var2 = a((double)var1.j(), var2);
         a(var0, var3, var5, var6, var2.f(), var2.g(), var2.h(), var2.i(), var7, var8, 2);
      } else {
         boolean var9 = false;
         int var11 = var8;
         byte var13;
         switch(var4) {
         case 0:
            var13 = -90;
            if (var7 == 7) {
               var8 = 0;
            } else if (var7 == 8) {
               var8 = 9;
            } else {
               var8 = var7;
            }

            if (var11 == 9) {
               var7 = 7;
            } else if (var11 == 0) {
               var7 = 8;
            } else {
               var7 = var11;
            }
            break;
         case 1:
            var13 = 90;
            if (var7 == 7) {
               var8 = 9;
            } else if (var7 == 8) {
               var8 = 0;
            } else {
               var8 = var7;
            }

            if (var11 == 9) {
               var7 = 8;
            } else if (var11 == 0) {
               var7 = 7;
            } else {
               var7 = var11;
            }
            break;
         case 2:
            var13 = 0;
            break;
         case 3:
            var13 = 0;
            break;
         default:
            var13 = 0;
         }

         if (var1.u().size() > 0) {
            a(var0, var1, var2, var13, var7, var8);
         } else {
            if (var3 == null || "".equals(var3) || var3.equals("\n")) {
               return;
            }

            var2 = a((double)var1.j(), var2);
            if (var3.startsWith("UYGUN OLMAYAN")) {
               zban var12 = new zban(var3, var5, Color.a(255, (Color)var1.o()), 2);
               com.aspose.cells.b.a.a.ze.a(var1.u(), (Object)var12);
               a(var0, var1, var2, var13, var7, var8);
            } else {
               b(var0, var1, var2, var3, var13, var5, var6, var7, var8);
            }
         }
      }

   }

   private static com.aspose.cells.b.a.b.zq a(double var0, com.aspose.cells.b.a.b.zq var2) {
      float var3 = Math.abs(var2.h() - var2.i());
      com.aspose.cells.b.a.b.zq var4 = new com.aspose.cells.b.a.b.zq(var2.f(), var2.g(), var2.h(), var2.i());
      if (var2.h() > var2.i()) {
         if (var0 >= 45.0D && var0 < 135.0D || var0 >= 225.0D && var0 < 315.0D) {
            var4.a(var4.f() + var3 / 2.0F);
            var4.b(var4.g() - var3 / 2.0F);
            var4.c(var2.i());
            var4.d(var2.h());
         }
      } else if (var0 >= 45.0D && var0 < 135.0D || var0 >= 225.0D && var0 < 315.0D) {
         var4.a(var4.f() - var3 / 2.0F);
         var4.b(var4.g() + var3 / 2.0F);
         var4.c(var2.i());
         var4.d(var2.h());
      }

      return var4;
   }

   private static void a(zn var0, zbkq var1, com.aspose.cells.b.a.b.zq var2, int var3, int var4, int var5) {
      zbaj var6 = new zbaj();
      var6.c(var1.r());
      var6.d(var1.s());
      var6.a(a(var4));
      var6.b(a(var5));
      com.aspose.cells.b.a.b.zq var7 = var2;
      if (var3 == 0) {
         var7 = a(var2, var1.j());
      }

      zbas var8 = new zbas(var7, var6, var1.u(), var1.n());
      var8.a(var0, (float)(-var3));
   }

   public static void a(zn var0, String var1, com.aspose.cells.b.a.b.zg var2, Color var3, float var4, float var5, float var6, float var7, int var8, int var9, int var10) {
      com.aspose.cells.b.a.b.zs var11 = a(var0, var1, var2, new com.aspose.cells.b.a.b.zt(var6, var7));
      if (var8 == 1) {
         var4 += (var6 - (float)var11.b()) / 2.0F;
      }

      if (var8 == 8) {
         var4 = var4 + var6 - (float)var11.b();
      }

      if (var9 == 1) {
         var5 += (var7 - (float)var11.c()) / 2.0F;
      } else if (var9 == 0) {
         var5 = var5 + var7 - (float)var11.c();
      }

      var6 = (float)var11.b();
      var7 = (float)var11.c();
      com.aspose.cells.b.a.b.zt var12 = var0.a("H", var2);
      var12.a((float)a((double)var12.b()));
      var12.b((float)a((double)(var12.c() / 2.0F + (float)(var2.d() / 2))));
      com.aspose.cells.b.a.b.zu var13 = new com.aspose.cells.b.a.b.zu(var3);

      try {
         float var14 = var4;
         if (var10 == 2) {
            var14 = var4 + var6 - var12.b();
         }

         float var15 = var5;
         com.aspose.cells.b.a.g.a.ze var16 = new com.aspose.cells.b.a.g.a.ze("(\\s){1,}");
         com.aspose.cells.b.a.g.a.zd var17 = var16.b(var1);
         int var18;
         float var21;
         int var34;
         if (var17.a() > 0) {
            var18 = -1;

            for(int var19 = 0; var19 < var17.a(); ++var19) {
               String var20 = "";
               if (var19 == 0) {
                  if (var17.a(var19).d() != 0) {
                     var20 = var1.substring(0, 0 + var17.a(var19).d());
                  }
               } else {
                  var20 = var1.substring(var17.a(var19 - 1).d() + var17.a(var19 - 1).e(), var17.a(var19 - 1).d() + var17.a(var19 - 1).e() + (var17.a(var19).d() - (var17.a(var19 - 1).d() + var17.a(var19 - 1).e())));
               }

               if (var15 != var5 && var15 + var12.c() * (float)var20.length() > var7 + var5) {
                  if (var10 == 2) {
                     var14 -= var12.b();
                  } else {
                     var14 += var12.b();
                  }

                  var15 = var5;
               }

               String var22;
               if (var9 == 1 && var18 < var19) {
                  var21 = 0.0F;
                  var22 = null;

                  for(int var23 = var19; var23 < var17.a(); ++var23) {
                     if (var23 == 0) {
                        if (var17.a(var23).d() != 0) {
                           var22 = var1.substring(0, 0 + var17.a(var23).d());
                        }
                     } else {
                        var22 = var1.substring(var17.a(var23 - 1).d() + var17.a(var23 - 1).e(), var17.a(var23 - 1).d() + var17.a(var23 - 1).e() + (var17.a(var23).d() - (var17.a(var23 - 1).d() + var17.a(var23 - 1).e())));
                     }

                     if (var22 == null || var7 - var21 < (float)var22.length() * var12.c()) {
                        break;
                     }

                     var18 = var23;
                     var21 += (float)var22.length() * var12.c();
                     if (var17.a(var23).a().indexOf("\n") == -1) {
                        var21 += (float)var17.a(var23).a().length() * var12.c();
                     }
                  }

                  if (var7 > var21) {
                     var15 += (var7 - var21) / 2.0F;
                  }
               }

               int var32;
               for(var32 = 0; var32 < var20.length(); ++var32) {
                  var22 = var20.substring(var32, var32 + 1);
                  com.aspose.cells.b.a.b.zt var33 = var0.a(var22, var2);
                  if (var15 + var12.c() > var5 + var7 && var15 != var5) {
                     if (var10 == 2) {
                        var14 -= var12.b();
                     } else {
                        var14 += var12.b();
                     }

                     var15 = var5;
                     if (var9 == 1) {
                        float var24 = 0.0F;

                        for(int var25 = var32; var25 < var20.length(); ++var25) {
                           var24 += var12.c();
                        }

                        if (var24 < var7) {
                           var15 = var5 + (var7 - var24) / 2.0F;
                        }
                     }

                     --var32;
                  } else {
                     if (a(var22)) {
                        var0.b(var14 + var12.b() / 2.0F, var15 + var12.c() / 2.0F);
                        var0.a(90.0F);
                        var0.a(var22, var2, var13, -var12.b() / 2.0F, -var12.c() / 2.0F);
                        var0.d();
                     } else {
                        var0.a(var22, var2, var13, var14 - (var33.b() - var12.b()) / 2.0F, var15);
                     }

                     var15 += var12.c();
                  }
               }

               var32 = var17.a(var19).a().indexOf("\n");
               if (var32 < 0) {
                  for(var34 = 0; var34 < var17.a(var19).e(); ++var34) {
                     if (var15 + var12.c() > var5 + var7 && var15 != var5) {
                        if (var10 == 2) {
                           var14 -= var12.b();
                        } else {
                           var14 += var12.b();
                        }

                        var15 = var5;
                        break;
                     }

                     var15 += var12.c();
                  }
               } else {
                  for(var34 = 0; var34 < var32; ++var34) {
                     if (var15 + var12.c() > var5 + var7 && var15 != var5) {
                        if (var10 == 2) {
                           var14 -= var12.b();
                        } else {
                           var14 += var12.b();
                        }
                        break;
                     }

                     var15 += var12.c();
                  }

                  if (var10 == 2) {
                     var14 -= var12.b();
                  } else {
                     var14 += var12.b();
                  }

                  var15 = var5;

                  for(var34 = var32 + 1; var34 < var17.a(var19).e(); ++var34) {
                     if (var15 + var12.c() > var5 + var7 && var15 != var5) {
                        if (var10 == 2) {
                           var14 -= var12.b();
                        } else {
                           var14 += var12.b();
                        }

                        var15 = var5;
                        break;
                     }

                     var15 += var12.c();
                  }
               }

               if (var19 == var17.a() - 1) {
                  var20 = var1.substring(var17.a(var19).d() + var17.a(var19).e(), var17.a(var19).d() + var17.a(var19).e() + (var1.length() - (var17.a(var19).d() + var17.a(var19).e())));
                  if (var15 != var5 && var15 + var12.c() * (float)var20.length() > var7) {
                     if (var10 == 2) {
                        var14 -= var12.b();
                     } else {
                        var14 += var12.b();
                     }

                     var15 = var5;
                  }

                  if (var15 == var5 && var15 + (float)var20.length() * var12.c() < var5 + var7 && var9 == 1) {
                     var15 += (var7 - (float)var20.length() * var12.c()) / 2.0F;
                  }

                  for(var34 = 0; var34 < var20.length(); ++var34) {
                     String var35 = var20.substring(var34, var34 + 1);
                     com.aspose.cells.b.a.b.zt var36 = var0.a(var35, var2);
                     if (var15 + var12.c() > var5 + var7 && var15 != var5) {
                        if (var10 == 2) {
                           var14 -= var12.b();
                        } else {
                           var14 += var12.b();
                        }

                        var15 = var5;
                        if (var9 == 1) {
                           float var37 = 0.0F;

                           for(int var26 = var34; var26 < var20.length(); ++var26) {
                              var37 += var12.c();
                           }

                           if (var37 < var7) {
                              var15 = var5 + (var7 - var37) / 2.0F;
                           }
                        }

                        --var34;
                     } else {
                        if (a(var35)) {
                           var0.b(var14 + var12.b() / 2.0F, var15 + var12.c() / 2.0F);
                           var0.a(90.0F);
                           var0.a(var35, var2, var13, -var12.b() / 2.0F, -var12.c() / 2.0F);
                           var0.d();
                        } else {
                           var0.a(var35, var2, var13, var14 - (var36.b() - var12.b()) / 2.0F, var15);
                        }

                        var15 += var12.c();
                     }
                  }
               }
            }
         } else {
            for(var18 = 0; var18 < var1.length(); ++var18) {
               String var30 = var1.substring(var18, var18 + 1);
               com.aspose.cells.b.a.b.zt var31 = var0.a(var30, var2);
               if (var15 + var12.c() > var5 + var7 && var15 != var5) {
                  if (var10 == 2) {
                     var14 -= var12.b();
                  } else {
                     var14 += var12.b();
                  }

                  var15 = var5;
                  if (var9 == 1) {
                     var21 = 0.0F;

                     for(var34 = var18; var34 < var1.length(); ++var34) {
                        var21 += var12.c();
                     }

                     if (var21 < var7) {
                        var15 = var5 + (var7 - var21) / 2.0F;
                     }
                  }

                  --var18;
               } else {
                  if (a(var30)) {
                     var0.b(var14 + var12.b() / 2.0F, var15 + var12.c() / 2.0F);
                     var0.a(90.0F);
                     var0.a(var30, var2, var13, -var12.b() / 2.0F, -var12.c() / 2.0F);
                     var0.d();
                  } else {
                     var0.a(var30, var2, var13, var14 - (var31.b() - var12.b()) / 2.0F, var15);
                  }

                  var15 += var12.c();
               }
            }
         }
      } finally {
         if (var13 != null) {
            var13.f();
         }

      }

   }

   private static com.aspose.cells.b.a.b.zs a(zn var0, String var1, com.aspose.cells.b.a.b.zg var2, com.aspose.cells.b.a.b.zt var3) {
      com.aspose.cells.b.a.b.zt var4 = var0.a("H", var2);
      var4.a((float)a((double)var4.b()));
      var4.b((float)a((double)(var4.c() / 2.0F + (float)(var2.d() / 2))));
      if (var1 != null && var1.length() != 0) {
         float var5 = var4.b();
         float var6 = var4.c();
         boolean var7 = false;
         float var8 = 0.0F;
         float var9 = 0.0F;
         com.aspose.cells.b.a.g.a.ze var10 = new com.aspose.cells.b.a.g.a.ze("(\\s){1,}");
         com.aspose.cells.b.a.g.a.zd var11 = var10.b(var1);
         int var12;
         if (var11.a() > 0) {
            for(var12 = 0; var12 < var11.a(); ++var12) {
               String var13 = "";
               if (var12 == 0) {
                  if (var11.a(var12).d() != 0) {
                     var13 = var1.substring(0, 0 + var11.a(var12).d());
                  }
               } else {
                  var13 = var1.substring(var11.a(var12 - 1).d() + var11.a(var12 - 1).e(), var11.a(var12 - 1).d() + var11.a(var12 - 1).e() + (var11.a(var12).d() - (var11.a(var12 - 1).d() + var11.a(var12 - 1).e())));
               }

               if (var9 != 0.0F && var9 + var4.c() * (float)var13.length() > var3.c()) {
                  var5 += var4.b();
                  var9 = 0.0F;
               }

               int var14;
               for(var14 = 0; var14 < var13.length(); ++var14) {
                  var13.substring(var14, var14 + 1);
                  if (var9 + var4.c() > var3.c() && var9 != 0.0F) {
                     var5 += var4.b();
                     var8 = var9;
                     var9 = 0.0F;
                     var7 = true;
                     --var14;
                  } else {
                     var9 += var4.c();
                  }
               }

               if (var9 > var6) {
                  var6 = var9;
               }

               var14 = var11.a(var12).a().indexOf("\n");
               int var15;
               if (var14 < 0) {
                  for(var15 = 0; var15 < var11.a(var12).e(); ++var15) {
                     if (var9 + var4.c() > var3.c() && var9 != 0.0F) {
                        var5 += var4.b();
                        var9 = 0.0F;
                        break;
                     }

                     var9 += var4.c();
                  }
               } else {
                  for(var15 = 0; var15 < var14; ++var15) {
                     if (var9 + var4.c() > var3.c() && var9 != 0.0F) {
                        var5 += var4.b();
                        var9 = 0.0F;
                        break;
                     }

                     var9 += var4.c();
                  }

                  var5 += var4.b();
                  var9 = 0.0F;

                  for(var15 = var14 + 1; var15 < var11.a(var12).e(); ++var15) {
                     if (var9 + var4.c() > var3.c() && var9 != 0.0F) {
                        var5 += var4.b();
                        var9 = 0.0F;
                        break;
                     }

                     var9 += var4.c();
                  }
               }

               if (var12 == var11.a() - 1) {
                  var13 = var1.substring(var11.a(var12).d() + var11.a(var12).e(), var11.a(var12).d() + var11.a(var12).e() + (var1.length() - (var11.a(var12).d() + var11.a(var12).e())));
                  if (var9 != 0.0F && var9 + var4.c() * (float)var13.length() > var3.c()) {
                     var5 += var4.b();
                     var9 = 0.0F;
                  }

                  for(var15 = 0; var15 < var13.length(); ++var15) {
                     var13.substring(var15, var15 + 1);
                     if (var9 + var4.c() > var3.c() && var9 != 0.0F) {
                        var5 += var4.b();
                        var8 = var9;
                        var9 = 0.0F;
                        var7 = true;
                        --var15;
                     } else {
                        var9 += var4.c();
                     }
                  }

                  if (var9 > var6) {
                     var6 = var9;
                  }
               }
            }
         } else {
            for(var12 = 0; var12 < var1.length(); ++var12) {
               var1.substring(var12, var12 + 1);
               if (var9 + var4.c() > var3.c() && var9 != 0.0F) {
                  var5 += var4.b();
                  var8 = var9;
                  var9 = 0.0F;
                  var7 = true;
                  --var12;
               } else {
                  var9 += var4.c();
               }
            }

            if (var9 > var6) {
               var6 = var9;
            }
         }

         if (var7) {
            var6 = var8;
         }

         return new com.aspose.cells.b.a.b.zs((int)(var5 + 0.5F), (int)(var6 + 0.5F));
      } else {
         return new com.aspose.cells.b.a.b.zs(0, 0);
      }
   }

   private static boolean a(String var0) {
      switch(b.a(var0)) {
      case 0:
      case 1:
      case 2:
      case 3:
      case 4:
      case 5:
      case 6:
      case 7:
      case 8:
      case 9:
      case 10:
      case 11:
         return true;
      default:
         return false;
      }
   }

   private static void b(zn var0, zbkq var1, com.aspose.cells.b.a.b.zq var2, String var3, int var4, com.aspose.cells.b.a.b.zg var5, Color var6, int var7, int var8) {
      com.aspose.cells.b.a.b.zv var9 = new com.aspose.cells.b.a.b.zv(com.aspose.cells.b.a.b.zv.c());
      var9.a(a(var7));
      var9.c(a(var8));
      switch(Math.abs(var4)) {
      case 0:
         var0.a(var3, var5, new com.aspose.cells.b.a.b.zu(var6), (com.aspose.cells.b.a.b.zq)var2, var9);
         break;
      case 90:
         com.aspose.cells.b.a.b.zn var10 = new com.aspose.cells.b.a.b.zn((int)(var2.j() + var2.h() / 2.0F), (int)(var2.k() + var2.i() / 2.0F));
         var0.b((float)var10.a(), (float)var10.b());
         var0.a((float)(-var4));
         var2 = new com.aspose.cells.b.a.b.zq(-(var2.i() / 2.0F), -(var2.h() / 2.0F), var2.i(), var2.h());
         var0.a(var3, var5, new com.aspose.cells.b.a.b.zu(var6), (com.aspose.cells.b.a.b.zq)var2, var9);
         var0.d();
         break;
      default:
         double var11 = Math.sqrt(Math.pow((double)var2.h(), 2.0D) + Math.pow((double)var2.i(), 2.0D));
         var9.b(4096);
         com.aspose.cells.b.a.b.zt var13 = var0.a(var3, var5, (int)var11, var9);
         var0.b(var2.j() + var2.h() / 2.0F, var2.k() + var2.i() / 2.0F);
         var0.a((float)(-var4));
         com.aspose.cells.b.a.b.zq var14 = new com.aspose.cells.b.a.b.zq(-var13.b() / 2.0F, -var13.c() / 2.0F, var13.b(), var13.c());
         var0.a(var3, var5, new com.aspose.cells.b.a.b.zu(var6), (com.aspose.cells.b.a.b.zq)var14, var9);
         var0.d();
      }

   }

   public static int a(int var0) {
      if (var0 == 1) {
         return 1;
      } else if (var0 != 7 && var0 != 9) {
         return var0 != 0 && var0 != 8 ? 0 : 2;
      } else {
         return 0;
      }
   }

   static int a(double var0) {
      return (int)Math.ceil(var0);
   }

   static float a(com.aspose.cells.b.a.b.zg var0) {
      return var0.h() / 4.0F;
   }

   static com.aspose.cells.b.a.b.zq a(zbkq var0) {
      zaly var1 = var0.m();
      ArrayList var2 = new ArrayList();
      com.aspose.cells.b.a.a.ze.a(var2, (Object)(new com.aspose.cells.b.a.b.zo(var0.h(), var0.i())));
      com.aspose.cells.b.a.a.ze.a(var2, (Object)(new com.aspose.cells.b.a.b.zo(var0.h(), var0.k().m())));
      com.aspose.cells.b.a.a.ze.a(var2, (Object)(new com.aspose.cells.b.a.b.zo(var0.k().l(), var0.i())));
      com.aspose.cells.b.a.a.ze.a(var2, (Object)(new com.aspose.cells.b.a.b.zo(var0.k().l(), var0.k().m())));
      com.aspose.cells.b.a.b.zo[] var3 = new com.aspose.cells.b.a.b.zo[2];
      if (!var1.a()) {
         float var4 = var1.f();
         float var5 = 0.0F;
         float var6 = 0.0F;
         if (var4 < 3.0F) {
            var4 = 3.0F;
         }

         switch(var1.i()) {
         case 0:
            var6 = 2.0F * var4;
            break;
         case 1:
            var6 = 3.0F * var4;
            break;
         case 2:
            var6 = 5.0F * var4;
         }

         switch(var1.h()) {
         case 0:
            var5 = 2.0F * var4;
            break;
         case 1:
            var5 = 3.0F * var4;
            break;
         case 2:
            var5 = 5.0F * var4;
         }

         if (var1.g() == 5) {
            var5 += 2.0F * var4;
            var6 += 2.0F * var4;
         }

         double var7 = Math.sqrt(Math.pow((double)var0.f(), 2.0D) + Math.pow((double)var0.g(), 2.0D));
         double var9 = 0.0D;
         double var11 = 0.0D;
         switch(var1.g()) {
         case 1:
         case 2:
         case 5:
            var9 = (double)(var0.f() * var6) / var7;
            var11 = (double)(var0.g() * var6) / var7;
         case 3:
         case 4:
         }

         double var13;
         if (var0.a != 1 && var0.a != 2) {
            var13 = (double)var0.k().l() - var9;
         } else {
            var13 = (double)var0.h() + var9;
         }

         double var15;
         if (var0.a != 1 && var0.a != 4) {
            var15 = (double)var0.k().m() - var11;
         } else {
            var15 = (double)var0.i() + var11;
         }

         double var17;
         double var19;
         double var21;
         double var23;
         switch(var0.a) {
         case 1:
            var17 = (double)var0.k().f();
            var19 = (double)var0.k().g();
            var21 = (double)var0.k().l();
            var23 = (double)var0.k().m();
            break;
         case 2:
            var17 = (double)var0.k().f();
            var19 = (double)var0.k().m();
            var21 = (double)var0.k().l();
            var23 = (double)var0.k().g();
            break;
         case 3:
            var17 = (double)var0.k().l();
            var19 = (double)var0.k().m();
            var21 = (double)var0.k().f();
            var23 = (double)var0.k().g();
            break;
         case 4:
            var17 = (double)var0.k().l();
            var19 = (double)var0.k().g();
            var21 = (double)var0.k().f();
            var23 = (double)var0.k().m();
            break;
         default:
            var17 = (double)var0.k().f();
            var19 = (double)var0.k().g();
            var21 = (double)var0.k().l();
            var23 = (double)var0.k().m();
         }

         double var25 = (double)var5;
         com.aspose.cells.b.a.b.zo[] var27;
         if (var1.g() == 0) {
            var27 = a(var17, var19, var17, var19, (double)var1.f(), var21, var23);
         } else {
            var27 = a(var17, var19, var13, var15, var25, var21, var23);
         }

         com.aspose.cells.b.a.a.ze.b(var2, var27);
         double var28;
         double var30;
         double var32;
         if (var1.g() == 3) {
            var28 = (double)(var6 / 2.0F);
            var9 = (double)var0.f() * var28 / var7;
            var11 = (double)var0.g() * var28 / var7;
            if (var0.a != 1 && var0.a != 2) {
               var30 = (double)var0.k().l() + var9;
            } else {
               var30 = (double)var0.h() - var9;
            }

            if (var0.a != 1 && var0.a != 4) {
               var32 = (double)var0.k().m() + var11;
            } else {
               var32 = (double)var0.i() - var11;
            }

            com.aspose.cells.b.a.a.ze.a(var2, (Object)(new com.aspose.cells.b.a.b.zo((float)var30, (float)var32)));
         } else if (var1.g() == 4) {
            var28 = (double)(var6 / 2.0F);
            var9 = (double)var0.f() * var28 / var7;
            var11 = (double)var0.g() * var28 / var7;
            if (var0.a != 1 && var0.a != 2) {
               var30 = (double)var0.k().l() + var9;
            } else {
               var30 = (double)var0.h() - var9;
            }

            if (var0.a != 1 && var0.a != 4) {
               var32 = (double)var0.k().m() + var11;
            } else {
               var32 = (double)var0.i() - var11;
            }

            com.aspose.cells.b.a.a.ze.a(var2, (Object)(new com.aspose.cells.b.a.b.zo((float)var30, (float)var32)));
         }

         float var37 = 0.0F;
         float var8 = 0.0F;
         switch(var1.l()) {
         case 0:
            var8 = 2.0F * var4;
            break;
         case 1:
            var8 = 3.0F * var4;
            break;
         case 2:
            var8 = 5.0F * var4;
         }

         switch(var1.k()) {
         case 0:
            var37 = 2.0F * var4;
            break;
         case 1:
            var37 = 3.0F * var4;
            break;
         case 2:
            var37 = 5.0F * var4;
         }

         if (var1.j() == 5) {
            var37 += 2.0F * var4;
            var8 += 2.0F * var4;
         }

         var9 = Math.sqrt(Math.pow((double)var0.f(), 2.0D) + Math.pow((double)var0.g(), 2.0D));
         var11 = 0.0D;
         var13 = 0.0D;
         switch(var1.j()) {
         case 1:
         case 2:
         case 5:
            var11 = (double)(var0.f() * var8) / var9;
            var13 = (double)(var0.g() * var8) / var9;
         case 3:
         case 4:
         }

         if (var0.a != 3 && var0.a != 4) {
            var19 = (double)var0.k().l() - var11;
         } else {
            var19 = (double)var0.h() + var11;
         }

         if (var0.a != 3 && var0.a != 2) {
            var21 = (double)var0.k().m() - var13;
         } else {
            var21 = (double)var0.i() + var13;
         }

         switch(var0.a) {
         case 1:
            var15 = (double)var0.k().l();
            var17 = (double)var0.k().m();
            var23 = (double)var0.h();
            var25 = (double)var0.i();
            break;
         case 2:
            var15 = (double)var0.k().l();
            var17 = (double)var0.i();
            var23 = (double)var0.h();
            var25 = (double)var0.k().m();
            break;
         case 3:
            var15 = (double)var0.h();
            var17 = (double)var0.i();
            var23 = (double)var0.k().l();
            var25 = (double)var0.k().m();
            break;
         case 4:
            var15 = (double)var0.h();
            var17 = (double)var0.k().m();
            var23 = (double)var0.k().l();
            var25 = (double)var0.i();
            break;
         default:
            var15 = (double)var0.h();
            var17 = (double)var0.i();
            var23 = (double)var0.k().l();
            var25 = (double)var0.k().m();
         }

         double var41 = (double)var37;
         a(var15, var17, var19, var21, var41, var23, var25);
         com.aspose.cells.b.a.b.zo[] var29;
         if (var1.j() == 0) {
            var29 = a(var15, var17, var15, var17, (double)var1.f(), var23, var25);
         } else {
            var29 = a(var15, var17, var19, var21, var41, var23, var25);
         }

         com.aspose.cells.b.a.a.ze.b(var2, var29);
         double var34;
         if (var1.j() == 3) {
            var30 = (double)(var8 / 2.0F);
            var11 = (double)var0.f() * var30 / var9;
            var13 = (double)var0.g() * var30 / var9;
            if (var0.a != 3 && var0.a != 4) {
               var32 = (double)var0.k().l() + var11;
            } else {
               var32 = (double)var0.h() - var11;
            }

            if (var0.a != 3 && var0.a != 2) {
               var34 = (double)var0.k().m() + var13;
            } else {
               var34 = (double)var0.i() - var13;
            }

            com.aspose.cells.b.a.a.ze.a(var2, (Object)(new com.aspose.cells.b.a.b.zo((float)var32, (float)var34)));
         } else if (var1.j() == 4) {
            var30 = (double)(var8 / 2.0F);
            var11 = (double)var0.f() * var30 / var9;
            var13 = (double)var0.g() * var30 / var9;
            if (var0.a != 3 && var0.a != 4) {
               var32 = (double)var0.k().l() + var11;
            } else {
               var32 = (double)var0.h() - var11;
            }

            if (var0.a != 3 && var0.a != 2) {
               var34 = (double)var0.k().m() + var13;
            } else {
               var34 = (double)var0.i() - var13;
            }

            com.aspose.cells.b.a.a.ze.a(var2, (Object)(new com.aspose.cells.b.a.b.zo((float)var32, (float)var34)));
            com.aspose.cells.b.a.a.ze.a(var2, (Object)(new com.aspose.cells.b.a.b.zo((float)(var15 - (double)(var8 / 2.0F)), (float)var17)));
            com.aspose.cells.b.a.a.ze.a(var2, (Object)(new com.aspose.cells.b.a.b.zo((float)(var15 + (double)(var8 / 2.0F)), (float)var17)));
            com.aspose.cells.b.a.a.ze.a(var2, (Object)(new com.aspose.cells.b.a.b.zo((float)var15, (float)(var17 - (double)(var37 / 2.0F)))));
            com.aspose.cells.b.a.a.ze.a(var2, (Object)(new com.aspose.cells.b.a.b.zo((float)var15, (float)(var17 + (double)(var37 / 2.0F)))));
         }
      }

      com.aspose.cells.b.a.b.zo[] var40 = a(var2);
      if (!var0.d && var0.j() != 0) {
         com.aspose.cells.b.a.b.a.zi var36 = new com.aspose.cells.b.a.b.a.zi();
         com.aspose.cells.b.a.b.zo var39 = new com.aspose.cells.b.a.b.zo(var0.k().f() + var0.k().h() / 2.0F, var0.k().g() + var0.k().i() / 2.0F);
         var36.a((float)var0.j(), var39);
         var36.a(var40);
      }

      com.aspose.cells.b.a.b.zq var38 = a(var40);
      return var38;
   }

   private static com.aspose.cells.b.a.b.zo[] a(double var0, double var2, double var4, double var6, double var8, double var10, double var12) {
      if (var12 == var2) {
         return new com.aspose.cells.b.a.b.zo[]{new com.aspose.cells.b.a.b.zo((float)var4, (float)(var6 - var8 / 2.0D)), new com.aspose.cells.b.a.b.zo((float)var4, (float)(var6 + var8 / 2.0D))};
      } else if (var10 == var0) {
         return new com.aspose.cells.b.a.b.zo[]{new com.aspose.cells.b.a.b.zo((float)(var4 - var8 / 2.0D), (float)var6), new com.aspose.cells.b.a.b.zo((float)(var4 + var8 / 2.0D), (float)var6)};
      } else {
         double var14 = (var12 - var2) / (var10 - var0);
         double var16 = -1.0D / var14;
         double var18 = var6 - var16 * var4;
         double var20 = 1.0D + var16 * var16;
         double var22 = 2.0D * var16 * var18 - 2.0D * var4 - 2.0D * var6 * var16;
         double var24 = var4 * var4 + var6 * var6 + var18 * var18 - var8 / 2.0D * var8 / 2.0D - 2.0D * var6 * var18;
         double var26 = (-var22 - Math.sqrt(var22 * var22 - 4.0D * var20 * var24)) / (2.0D * var20);
         double var28 = (-var22 + Math.sqrt(var22 * var22 - 4.0D * var20 * var24)) / (2.0D * var20);
         double var30 = var16 * var26 + var18;
         double var32 = var16 * var28 + var18;
         return new com.aspose.cells.b.a.b.zo[]{new com.aspose.cells.b.a.b.zo((float)var26, (float)var30), new com.aspose.cells.b.a.b.zo((float)var28, (float)var32)};
      }
   }

   static com.aspose.cells.b.a.b.zq a(com.aspose.cells.b.a.b.zo[] var0) {
      float var1 = 0.0F;
      float var2 = 0.0F;
      float var3 = 0.0F;
      float var4 = 0.0F;
      if (var0.length > 0) {
         var1 = var0[0].d();
         var2 = var0[0].d();
         var3 = var0[0].e();
         var4 = var0[0].e();
      }

      for(int var5 = 1; var5 < var0.length; ++var5) {
         com.aspose.cells.b.a.b.zo var6 = var0[var5];
         if (!com.aspose.cells.b.a.b.zo.a(var6, com.aspose.cells.b.a.b.zo.a())) {
            if (var6.d() < var1) {
               var1 = var6.d();
            }

            if (var6.d() > var2) {
               var2 = var6.d();
            }

            if (var6.e() < var3) {
               var3 = var6.e();
            }

            if (var6.e() > var4) {
               var4 = var6.e();
            }
         }
      }

      float var7 = (float)Math.ceil((double)(var2 - var1));
      if (var7 == 0.0F) {
         var7 = 1.0F;
      }

      float var8 = (float)Math.ceil((double)(var4 - var3));
      if (var8 == 0.0F) {
         var8 = 1.0F;
      }

      return new com.aspose.cells.b.a.b.zq(var1, var3, var7, var8);
   }

   static com.aspose.cells.b.a.b.zo[] a(ArrayList var0) {
      for(int var1 = 0; var1 < var0.size(); ++var1) {
         if (var0.get(var1) == null) {
            var0.remove(var1);
            --var1;
         }
      }

      com.aspose.cells.b.a.b.zo[] var3 = new com.aspose.cells.b.a.b.zo[var0.size()];

      for(int var2 = 0; var2 < var0.size(); ++var2) {
         var3[var2] = (com.aspose.cells.b.a.b.zo)var0.get(var2);
      }

      return var3;
   }

   static com.aspose.cells.b.a.b.zq a(zbkq var0, boolean var1) {
      float var2 = 0.0F;
      float var3 = 0.0F;
      float var4 = 1111.0F;
      float var5 = 26041.0F;
      ArrayList var6 = var0.l.a;
      if (var6.size() > 0) {
         Iterator var7 = var6.iterator();

         while(var7.hasNext()) {
            zak var8 = (zak)var7.next();
            if (var8.b() == 327) {
               var4 = com.aspose.cells.b.a.ze.a((Object)var8.a());
            }

            if (var8.b() == 328) {
               var5 = com.aspose.cells.b.a.ze.a((Object)var8.a());
            }
         }

         var2 = Math.abs(var0.f() * (var4 / 21600.0F));
         var3 = Math.abs(var0.g() * (var5 / 21600.0F));
      } else {
         var4 = 1111.0F;
         var5 = 26041.0F;
         var2 = Math.abs(var0.f() * 0.051435184F);
         var3 = Math.abs(var0.g() * 1.2056018F);
      }

      com.aspose.cells.b.a.b.zq var9 = new com.aspose.cells.b.a.b.zq();
      if (var4 > 0.0F && var5 > 0.0F) {
         if (var2 > var0.f() && var3 > var0.g()) {
            var9 = new com.aspose.cells.b.a.b.zq(var0.h(), var0.i(), var2, var3);
         } else if (var2 > var0.f() && var3 < var0.g()) {
            var9 = new com.aspose.cells.b.a.b.zq(var0.h(), var0.i(), var2, var0.k().i());
         } else if (var2 < var0.f() && var3 > var0.g()) {
            var9 = new com.aspose.cells.b.a.b.zq(var0.h(), var0.i(), var0.k().h(), var3);
         } else if (var2 < var0.f() && var3 < var0.g()) {
            var9 = new com.aspose.cells.b.a.b.zq(var0.h(), var0.i(), var0.k().h(), var0.k().i());
         }
      } else if (var4 < 0.0F && var5 > 0.0F) {
         if (var3 > var0.g()) {
            var9 = new com.aspose.cells.b.a.b.zq(var0.h(), var0.i(), var2 + var0.k().h() + 1.0F, var3);
         } else {
            var9 = new com.aspose.cells.b.a.b.zq(var0.h(), var0.i(), var2 + var0.k().h() + 1.0F, var0.k().i());
         }
      } else if (var4 < 0.0F && var5 < 0.0F) {
         var9 = new com.aspose.cells.b.a.b.zq(var0.h(), var0.i(), var2 + var0.k().h() + 1.0F, var3 + var0.k().i());
      } else if (var2 > var0.f()) {
         var9 = new com.aspose.cells.b.a.b.zq(var0.h(), var0.i(), var2, var3 + var0.k().i() + 1.0F);
      } else {
         var9 = new com.aspose.cells.b.a.b.zq(var0.h(), var0.i(), var0.k().h(), var3 + var0.k().i() + 1.0F);
      }

      if (var1 && var4 < 0.0F) {
         var9.a(var9.f() - var2);
      }

      if (var1 && var5 < 0.0F) {
         var9.b(var9.g() - var3);
      }

      var9.a(var0.m().f(), var0.m().f());
      return var9;
   }

   static com.aspose.cells.b.a.b.zq b(zbkq var0, boolean var1) {
      int var2 = var0.K();
      int var3 = var0.L();
      int var4 = var0.I();
      int var5 = var0.J();
      float var6;
      float var8;
      if (var2 + 1 <= var4) {
         var8 = (float)var0.a(var2 + 1, 0, var4, var0.M());
         var6 = var8 + var0.k().h() + 5.0F;
      } else {
         var8 = (float)var0.a(var4, var0.M(), var2 + 1, 0);
         var6 = var8 + 5.0F;
         if (var0.k().h() > var8) {
            var6 = var0.k().h() + 5.0F;
         }
      }

      float var7;
      float var9;
      if (var3 <= var5) {
         var9 = (float)var0.b(var3, 0, var5, var0.N());
         var7 = var9 + var0.k().i() + 5.0F;
      } else {
         var9 = (float)var0.b(var5, var0.N(), var3, 0);
         var7 = var9 + 5.0F;
         if (var0.k().i() > var9) {
            var7 = var0.k().i() + 5.0F;
         }
      }

      var0.e(var8);
      var0.f(var9);
      com.aspose.cells.b.a.b.zq var10 = new com.aspose.cells.b.a.b.zq(var0.k().f(), var0.k().g(), var6, var7);
      if (var1) {
         float var11;
         float var12;
         if (var0.L() > var0.J() && var0.K() + 1 <= var0.I()) {
            var11 = -var0.O();
            var12 = 0.0F;
         } else if (var0.K() + 1 > var0.I() && var0.L() <= var0.J()) {
            var11 = 0.0F;
            var12 = -var0.P();
         } else if (var0.K() + 1 > var0.I() && var0.L() > var0.J()) {
            var11 = 0.0F;
            var12 = 0.0F;
         } else {
            var11 = -var0.O();
            var12 = -var0.P();
         }

         var10.a(var10.f() + var11);
         var10.b(var10.g() + var12);
      }

      return var10;
   }

   private static Color a(zvm var0, float var1, float var2) {
      Color var3 = var0.b();
      float var4 = (float)(var3.getA() & 255);
      float var5 = (float)((var3.getR() & 255) + (int)var2);
      var5 = Math.max(0.0F, Math.min(var5, 255.0F)) * var1;
      float var6 = (float)((var3.getG() & 255) + (int)var2);
      var6 = Math.max(0.0F, Math.min(var6, 255.0F)) * var1;
      float var7 = (float)((var3.getB() & 255) + (int)var2);
      var7 = Math.max(0.0F, Math.min(var7, 255.0F)) * var1;
      return Color.fromArgb((int)var4, (int)var5, (int)var6, (int)var7);
   }

   private static void a(com.aspose.cells.b.a.b.zm var0, int var1, int var2, int var3, boolean var4, zaly var5) {
      float var6 = 0.0F;
      float var7 = 0.0F;
      if (var5.f() <= 0.0F) {
         if (var2 == 0) {
            switch(var1) {
            case 1:
               var6 = 4.0F;
               break;
            case 2:
               var6 = 4.0F;
               break;
            case 3:
               var6 = 4.0F;
               break;
            case 4:
               var6 = 4.0F;
               break;
            case 5:
               var6 = 4.0F;
            }
         } else if (var2 == 1) {
            switch(var1) {
            case 1:
               var6 = 4.0F;
               break;
            case 2:
               var6 = 4.0F;
               break;
            case 3:
               var6 = 4.0F;
               break;
            case 4:
               var6 = 4.0F;
               break;
            case 5:
               var6 = 4.0F;
            }
         } else {
            switch(var1) {
            case 1:
               var6 = 4.0F;
               break;
            case 2:
               var6 = 4.0F;
               break;
            case 3:
               var6 = 4.0F;
               break;
            case 4:
               var6 = 4.0F;
               break;
            case 5:
               var6 = 4.0F;
            }
         }

         if (var3 == 0) {
            switch(var1) {
            case 1:
               var7 = 4.0F;
               break;
            case 2:
               var7 = 4.0F;
               break;
            case 3:
               var7 = 4.0F;
               break;
            case 4:
               var7 = 4.0F;
               break;
            case 5:
               var7 = 4.0F;
            }
         } else if (var3 == 1) {
            switch(var1) {
            case 1:
               var7 = 6.0F;
               break;
            case 2:
               var7 = 4.0F;
               break;
            case 3:
               var7 = 4.0F;
               break;
            case 4:
               var7 = 4.0F;
               break;
            case 5:
               var7 = 5.0F;
            }
         } else {
            switch(var1) {
            case 1:
               var7 = 6.0F;
               break;
            case 2:
               var7 = 6.0F;
               break;
            case 3:
               var7 = 6.0F;
               break;
            case 4:
               var7 = 6.0F;
               break;
            case 5:
               var7 = 5.0F;
            }
         }
      } else {
         if (var2 == 0) {
            var6 = 2.0F;
         } else if (var2 == 1) {
            var6 = 3.0F;
         } else {
            var6 = 5.0F;
         }

         if (var3 == 0) {
            var7 = 3.0F;
         } else if (var3 == 1) {
            var7 = 3.0F;
         } else {
            var7 = 5.0F;
         }
      }

      com.aspose.cells.b.a.b.a.za var8;
      switch(var1) {
      case 1:
         var8 = new com.aspose.cells.b.a.b.a.za(var6, var7);
         if (var4) {
            var0.a((com.aspose.cells.b.a.b.a.zd)var8);
         } else {
            var0.b((com.aspose.cells.b.a.b.a.zd)var8);
         }
         break;
      case 2:
         var8 = new com.aspose.cells.b.a.b.a.za(var6, var7);
         var8.a(0.9F);
         if (var4) {
            var0.a((com.aspose.cells.b.a.b.a.zd)var8);
         } else {
            var0.b((com.aspose.cells.b.a.b.a.zd)var8);
         }
         break;
      case 3:
         com.aspose.cells.b.a.b.a.ze var9 = new com.aspose.cells.b.a.b.a.ze();
         com.aspose.cells.b.a.b.zo[] var10 = new com.aspose.cells.b.a.b.zo[]{new com.aspose.cells.b.a.b.zo(-var6 / 2.0F, 0.0F), new com.aspose.cells.b.a.b.zo(0.0F, -var7 / 2.0F), new com.aspose.cells.b.a.b.zo(var6 / 2.0F, 0.0F), new com.aspose.cells.b.a.b.zo(0.0F, var7 / 2.0F)};
         var9.b(var10);
         com.aspose.cells.b.a.b.a.zd var11 = new com.aspose.cells.b.a.b.a.zd(var9, (com.aspose.cells.b.a.b.a.ze)null);
         if (var4) {
            var0.a(var11);
         } else {
            var0.b(var11);
         }
         break;
      case 4:
         com.aspose.cells.b.a.b.a.ze var14 = new com.aspose.cells.b.a.b.a.ze();
         com.aspose.cells.b.a.b.zq var15 = new com.aspose.cells.b.a.b.zq(-var6 / 2.0F, -var7 / 2.0F, var6, var7);
         var14.a(var15);
         com.aspose.cells.b.a.b.a.zd var16 = new com.aspose.cells.b.a.b.a.zd(var14, (com.aspose.cells.b.a.b.a.ze)null);
         if (var4) {
            var0.a(var16);
         } else {
            var0.b(var16);
         }
         break;
      case 5:
         var6 += 0.5F;
         var7 += 0.5F;
         com.aspose.cells.b.a.b.a.ze var12 = new com.aspose.cells.b.a.b.a.ze();
         var12.a(new com.aspose.cells.b.a.b.zo(var6 / 2.0F, -var7), new com.aspose.cells.b.a.b.zo(0.0F, 0.0F));
         var12.a(new com.aspose.cells.b.a.b.zo(-var6 / 2.0F, -var7), new com.aspose.cells.b.a.b.zo(0.0F, 0.0F));
         com.aspose.cells.b.a.b.a.zd var13 = new com.aspose.cells.b.a.b.a.zd((com.aspose.cells.b.a.b.a.ze)null, var12);
         var13.a(0);
         var13.b(2);
         var13.a(2, 2);
         if (var4) {
            var0.a(var13);
         } else {
            var0.b(var13);
         }
      }

   }

   private static void a(int var0, int var1, int var2, zaly var3, float[] var4, float[] var5) {
      if (var3.f() <= 1.0F) {
         if (var1 == 0) {
            switch(var0) {
            case 1:
            case 2:
            case 3:
            case 4:
               var4[0] = 4.5F;
               break;
            case 5:
               var4[0] = 6.5F;
            }
         } else if (var1 == 1) {
            switch(var0) {
            case 1:
            case 2:
            case 3:
            case 4:
               var4[0] = 7.0F;
               break;
            case 5:
               var4[0] = 9.0F;
            }
         } else {
            switch(var0) {
            case 1:
            case 2:
            case 3:
            case 4:
               var4[0] = 12.5F;
               break;
            case 5:
               var4[0] = 13.5F;
            }
         }

         if (var2 == 0) {
            switch(var0) {
            case 1:
            case 2:
            case 3:
            case 4:
               var5[0] = 4.5F;
               break;
            case 5:
               var5[0] = 6.0F;
            }
         } else if (var2 == 1) {
            switch(var0) {
            case 1:
            case 2:
            case 3:
            case 4:
               var5[0] = 7.0F;
               break;
            case 5:
               var5[0] = 8.5F;
            }
         } else {
            switch(var0) {
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
               var5[0] = 12.5F;
            }
         }
      } else {
         if (var1 == 0) {
            switch(var0) {
            case 1:
            case 2:
            case 3:
            case 4:
               var4[0] = 4.0F;
               break;
            case 5:
               var4[0] = 10.0F;
            }
         } else if (var1 == 1) {
            switch(var0) {
            case 1:
            case 2:
            case 3:
            case 4:
               var4[0] = 8.0F;
               break;
            case 5:
               var4[0] = 14.0F;
            }
         } else {
            switch(var0) {
            case 1:
            case 2:
            case 3:
            case 4:
               var4[0] = 16.0F;
               break;
            case 5:
               var4[0] = 20.0F;
            }
         }

         if (var2 == 0) {
            switch(var0) {
            case 1:
            case 2:
            case 3:
            case 4:
               var5[0] = 4.0F;
               break;
            case 5:
               var5[0] = 10.0F;
            }
         } else if (var2 == 1) {
            switch(var0) {
            case 1:
            case 2:
            case 3:
            case 4:
               var5[0] = 8.0F;
               break;
            case 5:
               var5[0] = 14.0F;
            }
         } else {
            switch(var0) {
            case 1:
            case 2:
            case 3:
            case 4:
               var5[0] = 16.0F;
               break;
            case 5:
               var5[0] = 20.0F;
            }
         }
      }

   }

   static com.aspose.cells.b.a.b.zq b(zbkq var0) {
      float var1 = 0.0F;
      float var2 = 0.0F;
      float var3 = 0.0F;
      float var4 = 0.0F;
      float var5 = 0.0F;
      float var6 = 0.0F;
      float var7 = 0.0F;
      if (var0.l.a.size() > 0) {
         if (((zak)var0.l.a.get(0)).b() == 327) {
            var7 = (var0.f() > var0.g() ? var0.f() : var0.g()) * (com.aspose.cells.b.a.ze.a((Object)((zak)var0.l.a.get(0)).a()) - 10800.0F) / 21600.0F;
         } else {
            var7 = 0.0F;
         }
      } else {
         var7 = 0.0F;
      }

      float[] var8;
      float[] var9;
      if (var0.m().g() != 0) {
         var8 = new float[]{var2};
         var9 = new float[]{var1};
         a(var0.m().g(), var0.m().h(), var0.m().i(), var0.m(), var8, var9);
         var2 = var8[0];
         var1 = var9[0];
      }

      if (var0.m().j() != 0) {
         var8 = new float[]{var4};
         var9 = new float[]{var3};
         a(var0.m().j(), var0.m().k(), var0.m().l(), var0.m(), var8, var9);
         var4 = var8[0];
         var3 = var9[0];
      }

      float var10 = var0.m().f();
      if (var0.f() > var0.g()) {
         if (var0.g() >= var1 && var0.g() >= var3) {
            var6 = var1 + var3 + var10 + 1.0F;
         } else {
            var6 += var10 + 2.0F * (var1 > var3 ? var1 : var3);
         }

         if (var7 <= var0.f() / 2.0F && var7 >= -var0.f() / 2.0F) {
            var5 += var2 + var4;
         } else {
            var5 += Math.abs(var7) - var0.f() / 2.0F + var10 / 2.0F;
         }
      } else {
         var5 += var2 + var4;
         if (var2 > 0.0F || var4 > 0.0F || var0.f() <= 0.0F) {
            var5 += var10;
         }

         if (var7 <= var0.g() / 2.0F && var7 >= -var0.g() / 2.0F) {
            var6 = var1 + var3 + var10 + 1.0F;
         } else {
            var6 += Math.abs(var7) - var0.g() / 2.0F + var10 / 2.0F;
         }
      }

      com.aspose.cells.b.a.b.zq var11;
      if (var0.j() == 180 && (var3 > 0.0F || var4 > 0.0F)) {
         if (var1 == 0.0F && var2 == 0.0F) {
            var11 = new com.aspose.cells.b.a.b.zq(var0.h(), var0.i(), var0.k().h() + var5, var0.k().i() + var6);
         } else {
            var11 = new com.aspose.cells.b.a.b.zq(var0.h() - var4 / 2.0F, var0.i() - var3 / 2.0F, var0.k().h() + var5, var0.k().i() + var6);
         }
      } else if (var1 <= 0.0F && var2 <= 0.0F) {
         var11 = new com.aspose.cells.b.a.b.zq(var0.h(), var0.i(), var0.k().h() + var5, var0.k().i() + var6);
      } else {
         var11 = new com.aspose.cells.b.a.b.zq(var0.h() - var2 / 2.0F, var0.i() - var1 / 2.0F, var0.k().h() + var5, var0.k().i() + var6);
      }

      return var11;
   }

   static com.aspose.cells.b.a.b.zq c(zbkq var0) {
      new com.aspose.cells.b.a.b.zq();
      float var2 = 0.0F;
      float var3 = 0.0F;
      float var4 = 0.0F;
      float var5 = 0.0F;
      double var6 = zbie.a((double)var0.j());
      double var8 = zbie.a((double)(90 - var0.j()));
      var2 = (float)((double)var0.f() * Math.sin(var6));
      var3 = (float)((double)var0.f() * Math.cos(var6));
      var4 = (float)((double)var0.g() * Math.cos(var8));
      var5 = (float)((double)var0.g() * Math.sin(var8));
      float var10 = 0.0F;
      float var11 = 0.0F;
      var10 = Math.abs(var3) + Math.abs(var4);
      var11 = Math.abs(var2) + Math.abs(var5);
      com.aspose.cells.b.a.b.zq var1 = new com.aspose.cells.b.a.b.zq(var0.h(), var0.i(), var10, var11);
      var1.a(var0.m().f(), var0.m().f());
      return var1;
   }

   static com.aspose.cells.b.a.b.zq d(zbkq var0) {
      float var1 = 0.0F;
      float var2 = 0.0F;
      float var3 = 0.0F;
      float var4 = 0.0F;
      float var5 = 0.0F;
      float var6 = 0.0F;
      float var7 = var0.m().f();
      if (var0.l != null) {
         var6 = (var0.f() > var0.g() ? var0.f() : var0.g()) * (com.aspose.cells.b.a.ze.a((Object)((zak)var0.l.a.get(0)).a()) - 10800.0F) / 21600.0F;
      } else {
         var6 = (var0.f() > var0.g() ? var0.f() : var0.g()) * 10800.0F / 21600.0F;
      }

      float[] var8;
      float[] var9;
      if (var0.m().g() != 0) {
         var8 = new float[]{var2};
         var9 = new float[]{var1};
         b(var0.m().g(), var0.m().h(), var0.m().i(), var0.m(), var8, var9);
         var2 = var8[0];
         var1 = var9[0];
      }

      if (var0.m().j() != 0) {
         var8 = new float[]{var2};
         var9 = new float[]{var3};
         b(var0.m().j(), var0.m().k(), var0.m().l(), var0.m(), var8, var9);
         var2 = var8[0];
         var3 = var9[0];
      }

      if (var0.f() > var0.g()) {
         var5 += var7 + var1 + var3;
         if (Math.abs(var6) >= var0.f() / 2.0F) {
            var4 += var7 / 2.0F + Math.abs(var6) - var0.f() / 2.0F;
         } else {
            var4 += 0.0F;
         }
      } else {
         var4 = var7 + var1 + var3;
         if (Math.abs(var6) >= var0.g() / 2.0F) {
            var5 += var7 / 2.0F + Math.abs(var6) - var0.g() / 2.0F;
         }
      }

      com.aspose.cells.b.a.b.zq var10 = new com.aspose.cells.b.a.b.zq(var0.h(), var0.i(), var0.k().h() + var4, var0.k().i() + var5);
      return var10;
   }

   private static void b(int var0, int var1, int var2, zaly var3, float[] var4, float[] var5) {
      if (var3.f() <= 1.0F) {
         if (var1 == 0) {
            switch(var0) {
            case 1:
               var4[0] = 4.0F;
               break;
            case 2:
               var4[0] = 4.0F;
               break;
            case 3:
               var4[0] = 4.0F;
               break;
            case 4:
               var4[0] = 4.0F;
               break;
            case 5:
               var4[0] = 8.0F;
            }
         } else if (var1 == 1) {
            switch(var0) {
            case 1:
               var4[0] = 4.0F;
               break;
            case 2:
               var4[0] = 4.0F;
               break;
            case 3:
               var4[0] = 4.0F;
               break;
            case 4:
               var4[0] = 4.0F;
               break;
            case 5:
               var4[0] = 8.0F;
            }
         } else {
            switch(var0) {
            case 1:
               var5[0] = 4.0F;
               break;
            case 2:
               var5[0] = 4.0F;
               break;
            case 3:
               var5[0] = 4.0F;
               break;
            case 4:
               var5[0] = 4.0F;
               break;
            case 5:
               var5[0] = 8.0F;
            }
         }

         if (var2 == 0) {
            switch(var0) {
            case 1:
               var5[0] = 4.0F;
               break;
            case 2:
               var5[0] = 4.0F;
               break;
            case 3:
               var5[0] = 4.0F;
               break;
            case 4:
               var5[0] = 4.0F;
               break;
            case 5:
               var5[0] = 8.0F;
            }
         } else if (var2 == 1) {
            switch(var0) {
            case 1:
               var5[0] = 6.0F;
               break;
            case 2:
               var5[0] = 4.0F;
               break;
            case 3:
               var5[0] = 4.0F;
               break;
            case 4:
               var5[0] = 4.0F;
               break;
            case 5:
               var5[0] = 10.0F;
            }
         } else {
            switch(var0) {
            case 1:
               var5[0] = 6.0F;
               break;
            case 2:
               var5[0] = 6.0F;
               break;
            case 3:
               var5[0] = 6.0F;
               break;
            case 4:
               var5[0] = 6.0F;
               break;
            case 5:
               var5[0] = 10.0F;
            }
         }
      } else {
         if (var1 == 0) {
            var4[0] = 3.0F;
         } else if (var1 == 1) {
            var4[0] = 3.0F;
         } else {
            var4[0] = 5.0F;
         }

         if (var2 == 0) {
            var5[0] = 3.0F;
         } else if (var2 == 1) {
            var5[0] = 3.0F;
         } else {
            var5[0] = 5.0F;
         }
      }

   }

   static com.aspose.cells.b.a.b.zq e(zbkq var0) {
      float var1 = 0.0F;
      float var2 = 0.0F;
      float var3 = 0.0F;
      float var4 = 0.0F;
      float var5 = var0.h();
      float var6 = var0.i();
      float var7 = var0.f();
      float var8 = var0.g();
      float var9 = var0.m().f();
      if (var0.l.a.size() > 0) {
         var1 = (float)((zak)var0.l.a.get(0)).a() / 21600.0F * var7;
         var2 = (float)((zak)var0.l.a.get(1)).a() / 21600.0F * var8;
         var3 = (float)((zak)var0.l.a.get(2)).a() / 21600.0F * var7;
         var4 = (float)((zak)var0.l.a.get(3)).a() / 21600.0F * var8;
      }

      boolean var10 = var0.E();
      boolean var11 = var0.D();
      if (var1 > 0.0F && var2 > 0.0F && var3 > 0.0F && var4 > 0.0F && var2 > var8 && var4 > var8) {
         var7 += var9;
         var8 = var2 + var9;
      }

      com.aspose.cells.b.a.b.zq var12 = new com.aspose.cells.b.a.b.zq(var0.h(), var0.i(), var7, var8);
      return var12;
   }

   static com.aspose.cells.b.a.b.zq a(com.aspose.cells.b.a.b.zq var0, int var1) {
      com.aspose.cells.b.a.b.a.zi var2 = new com.aspose.cells.b.a.b.a.zi();
      com.aspose.cells.b.a.b.zo var3 = new com.aspose.cells.b.a.b.zo(var0.f() + var0.h() / 2.0F, var0.g() + var0.i() / 2.0F);
      var2.a((float)var1, var3);
      com.aspose.cells.b.a.b.zo[] var4 = new com.aspose.cells.b.a.b.zo[]{new com.aspose.cells.b.a.b.zo(var0.f(), var0.g()), new com.aspose.cells.b.a.b.zo(var0.f() + var0.h(), var0.g()), new com.aspose.cells.b.a.b.zo(var0.f(), var0.g() + var0.i()), new com.aspose.cells.b.a.b.zo(var0.f() + var0.h(), var0.g() + var0.i())};
      var2.a(var4);
      return a(var4);
   }

   static com.aspose.cells.b.a.b.zq a(com.aspose.cells.b.a.b.zo[] var0, com.aspose.cells.b.a.b.zo var1, int var2) {
      com.aspose.cells.b.a.b.a.zi var3 = new com.aspose.cells.b.a.b.a.zi();
      var3.a((float)var2, var1);
      var3.a(var0);
      return a(var0);
   }

   static com.aspose.cells.b.a.b.zq a(com.aspose.cells.b.a.b.zq var0, zach var1, int var2, int var3) {
      float var4 = 21600.0F;
      float var5 = 1.0F;
      float var6 = 1.0F;
      ArrayList var7 = new ArrayList();
      switch(var1.a.size()) {
      case 1:
         if (((zak)var1.a.get(0)).b() == 327) {
            var6 = com.aspose.cells.b.a.ze.a((Object)((zak)var1.a.get(0)).a()) / var4 * var0.h();
            var5 = var0.i() - 2.0F * var0.i() * (5047.0F / var4);
         } else {
            var6 = var0.h() * (16136.0F / var4);
            var5 = var0.i() - 2.0F * com.aspose.cells.b.a.ze.a((Object)((zak)var1.a.get(0)).a()) / var4 * var0.i();
         }
         break;
      case 2:
         var6 = com.aspose.cells.b.a.ze.a((Object)((zak)var1.a.get(0)).a()) / var4 * var0.h();
         var5 = var0.i() - 2.0F * com.aspose.cells.b.a.ze.a((Object)((zak)var1.a.get(1)).a()) / var4 * var0.i();
         break;
      default:
         var5 = var0.i() - 2.0F * var0.i() * (5047.0F / var4);
         var6 = var0.h() * (16136.0F / var4);
      }

      if (var5 <= 0.0F && var6 == var0.h()) {
         com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.f(), var0.i() / 2.0F + var0.g())));
         com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.h() + var0.f(), var0.g())));
         com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.h() + var0.f(), var0.i() / 2.0F + var0.g())));
         com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.h() + var0.f(), var0.i() + var0.g())));
      } else if (var5 <= 0.0F && var6 <= 0.0F) {
         com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.f(), var0.g())));
         com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.h() + var0.f(), var0.i() / 2.0F + var0.g())));
         com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.f(), var0.i() + var0.g())));
      } else {
         switch(var2) {
         case 1:
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.f(), (var0.i() - var5) / 2.0F + var0.g())));
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var6 + var0.f(), (var0.i() - var5) / 2.0F + var0.g())));
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var6 + var0.f(), var0.g())));
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.h() + var0.f(), var0.i() / 2.0F + var0.g())));
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var6 + var0.f(), var0.i() + var0.g())));
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var6 + var0.f(), var0.i() - (var0.i() - var5) / 2.0F + var0.g())));
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.f(), var0.i() - (var0.i() - var5) / 2.0F + var0.g())));
            break;
         case 2:
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.f(), (var0.i() - var5) / 2.0F + var0.g())));
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var6 + var0.f(), (var0.i() - var5) / 2.0F + var0.g())));
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var6 + var0.f(), var0.g())));
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.h() + var0.f(), var0.i() / 2.0F + var0.g())));
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var6 + var0.f(), var0.i() + var0.g())));
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var6 + var0.f(), var0.i() - (var0.i() - var5) / 2.0F + var0.g())));
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.f(), var0.i() - (var0.i() - var5) / 2.0F + var0.g())));
            break;
         case 3:
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.f(), var0.i() / 2.0F + var0.g())));
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.h() - var6 + var0.f(), var0.g())));
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.h() - var6 + var0.f(), (var0.i() - var5) / 2.0F + var0.g())));
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.h() + var0.f(), (var0.i() - var5) / 2.0F + var0.g())));
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.h() + var0.f(), (var0.i() - var5) / 2.0F + var5 + var0.g())));
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.h() - var6 + var0.f(), var0.i() - (var0.i() - var5) / 2.0F + var0.g())));
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.h() - var6 + var0.f(), var0.i() + var0.g())));
            break;
         case 4:
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.f(), var0.i() / 2.0F + var0.g())));
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.h() - var6 + var0.f(), var0.g())));
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.h() - var6 + var0.f(), (var0.i() - var5) / 2.0F + var0.g())));
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.h() + var0.f(), (var0.i() - var5) / 2.0F + var0.g())));
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.h() + var0.f(), (var0.i() - var5) / 2.0F + var5 + var0.g())));
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.h() - var6 + var0.f(), var0.i() - (var0.i() - var5) / 2.0F + var0.g())));
            com.aspose.cells.b.a.a.ze.a(var7, (Object)(new com.aspose.cells.b.a.b.zo(var0.h() - var6 + var0.f(), var0.i() + var0.g())));
         }
      }

      com.aspose.cells.b.a.b.zo[] var8 = a(var7);
      com.aspose.cells.b.a.b.zo var9 = new com.aspose.cells.b.a.b.zo(var0.f() + var0.h() / 2.0F, var0.g() + var0.i() / 2.0F);
      return a(var8, var9, var3);
   }
}
